Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1shqDM-009tNY-Si for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Aug 2024 12:49:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1shqDL-005Ekc-1i for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Aug 2024 12:49:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1shqDK-005EiY-Ju for pgsql-hackers@lists.postgresql.org; Sat, 24 Aug 2024 12:49:55 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1shqDE-001DRd-ST for pgsql-hackers@lists.postgresql.org; Sat, 24 Aug 2024 12:49:53 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2f025b94e07so25936741fa.0 for ; Sat, 24 Aug 2024 05:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724503787; x=1725108587; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bHCvPySyolpy21dDVe/5itWxqaI0P6ktbk3mJEHhQdM=; b=LD0KKNscSnBAXHyP1Px78qacQt2rrz4fNoT026mTWMqFa5yjqCwErxLI6z/hnBLxMd 1jn3Gik08K+PkasXVPdsapXzW4mnf6B4pXI5HtQFvtwB2r8G8f8Pdx1XG3D/tdKF+ldR 1bXpSkOjVoVocV7JLZ3bFSPYCLkJnHk3Sg1QDGfCV7RbqcUIDIjozoMSOq2/qgBMNafI VGh3orwtNL8dKQD6IUadsDVl1ztjq5hnOOMP3uu+MGEXgJFJ+Ccsi60O1A+EMRebMfW8 yDaXHD1TxnIKLSHXMzGkiDO82j9hjOTV3IGAqPNjFSXEwI/50c2E3ykUORrJHt5nRQ7n +ZEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724503787; x=1725108587; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bHCvPySyolpy21dDVe/5itWxqaI0P6ktbk3mJEHhQdM=; b=Oa7UXItVKk4oOuEuZAo4vYCXXvTSCcAZkAl1g+6iy2VWAHeFPdHRwoPmPXGu8YF3I4 voePiue9M8dndsaHl1nHGL7Q2l9uGsfA9eOyXbWlEPXCaPwmqdiNyWQFsY61o0L3mFga fnk7BMEP6YpCeZD+OwP0Clkoh1ztR1tGhpywuIh+m8bO13Moi5faWAdzkVn5VSdrjRI9 7H9dbGxFgd3YUcjuK5p84Q7SrzWLD/c5p+TMCscvamWGNOs+kPny3bBUDLcmlejZVs2e AoE9izmsNbwxsrW+fLZrkE1bLvPvScRqKXyYmiDHbLIalY05lS0XmPv6aaCaD0YME1nO /crQ== X-Forwarded-Encrypted: i=1; AJvYcCVygU/KtLD0NrM09usC8VeaERuO/Izmr7E/1qOM2Q39vfaZHvIBUbZDJq9BLMvGqRmPuzY9t1ejYR0O0/I0@lists.postgresql.org X-Gm-Message-State: AOJu0Yw8FCvFOR/5MhBHuWDDP6xKvfxGjRP1bMUJjPMPr2Y0NB6bCtpx JPwoYAu6ZR5Kv7QqXi9nWaKKt6qyDTwIC2F5T8EJEGXZvz/ij/MNotdPRtORTEhF4njAKzBF12n GK7pRoVIqrNnQoByZVB6rnf1bfFg= X-Google-Smtp-Source: AGHT+IFwSMbw7lTmDToO8c4QCIb2VpmdVrxOhQRe9WxQ6Xu1+yBLLMUAO8GEJHSSD4JTX4W/Lu3bl3gJrotLPKuR1rg= X-Received: by 2002:a05:651c:507:b0:2ef:2dc7:a8f7 with SMTP id 38308e7fff4ca-2f4f48ef4bcmr36591521fa.7.1724503786491; Sat, 24 Aug 2024 05:49:46 -0700 (PDT) MIME-Version: 1.0 References: <57c12c52-123c-4a13-a258-02639473fa17@dunslane.net> In-Reply-To: From: Junwang Zhao Date: Sat, 24 Aug 2024 20:49:34 +0800 Message-ID: Subject: Re: Official devcontainer config To: Andrew Dunstan Cc: Peter Eisentraut , PostgreSQL Hackers , Andrey Borodin , Jelte Fennema-Nio Content-Type: multipart/mixed; boundary="0000000000009bafad06206d5355" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009bafad06206d5355 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi hackers, On Sun, Aug 4, 2024 at 10:12=E2=80=AFPM Andrew Dunstan wrote: > > > On 2024-08-03 Sa 10:13 PM, Junwang Zhao wrote: > > On Sat, Aug 3, 2024 at 7:30=E2=80=AFPM Andrew Dunstan wrote: > >> > >> On 2024-08-02 Fr 2:45 PM, Peter Eisentraut wrote: > >>> On 01.08.24 23:38, Andrew Dunstan wrote: > >>>> Not totally opposed, and I will probably give it a try very soon, bu= t > >>>> I'm wondering if this really needs to go in the core repo. We've > >>>> generally shied away from doing much in the way of editor / devenv > >>>> support, trying to be fairly agnostic. It's true we carry > >>>> .dir-locals.el and .editorconfig, so that's not entirely true, but > >>>> those are really just about supporting our indentation etc. standard= s. > >>> Yeah, the editor support in the tree ought to be minimal and factual, > >>> based on coding standards and widely recognized best practices, not a > >>> collection of one person's favorite aliases and scripts. If the > >>> scripts are good, let's look at them and maybe put them under > >>> src/tools/ for everyone to use. But a lot of this looks like it will > >>> requite active maintenance if output formats or node formats or build > >>> targets etc. change. And other things require specific local paths. > >>> That's fine for a local script or something, but not for a mainline > >>> tool that the community will need to maintain. > >>> > >>> I suggest to start with a very minimal configuration. What are the > >>> settings that absolute everyone will need, maybe to set indentation > >>> style or something. > >>> > >> I believe you can get VS Code to support editorconfig, so from that PO= V > >> maybe we don't need to do anything. > >> > >> I did try yesterday with the code from the OP's patch symlinked into m= y > >> repo, but got an error with the Docker build, which kinda reinforces > >> your point. > > The reason symlink does not work is that configure_vscode needs to copy > > launch.json and tasks.json into .vscode, it has to be in the > > WORKDIR/.devcontainer. > > > That's kind of awful. Anyway, I think we don't need to do anything about > ignoring those. The user should simply add entries for them to > .git/info/exclude or their local global exclude file (I have > core.excludesfile =3D /home/andrew/.gitignore set.) > > I was eventually able to get it to work without using a symlink. > > > cheers > > > andrew > > > -- > Andrew Dunstan > EDB: https://www.enterprisedb.com > I did some work on the **devcontainer config** today, hoping this can address some of the concerns raised on this thread. 1. I created a separate git repo named **Unofficial devcontainer config for Postgres**[1]. 2. The usage is quite simple, clone the repo directly into postgres's tree = root, and reopen in DevContainer (See REAME in [1] if you are interested). 3. Using Tristan's vscode code extension postgres-hacker as the formatter, pgindent will be called on file save, I found this quite convenient. 4. Remove the git settings, Dev container copies the global ~/.gitconfig into the container by default, so normally it is not necessary to add extra git aliases. What I haven't addressed is that the repo still uses specific local paths, I think this is ok since the code is not going into the core. One thing I want to ask is, is there any objection to adding the .devcontainer and .vscode to the .gitignore file? There are *.vcproj and pgsql.sln in .gitignore, so I guess it's ok to add .devcontainer and .vscode? [1]: https://github.com/pghacking/.devcontainer --=20 Regards Junwang Zhao --0000000000009bafad06206d5355 Content-Type: application/octet-stream; name="v1-0001-add-.devcontainer-and-.vscode-to-.gitignore.patch" Content-Disposition: attachment; filename="v1-0001-add-.devcontainer-and-.vscode-to-.gitignore.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m084zp180 RnJvbSBmY2MwOGQwZjQ3ZTU3MzViYzI1NTAxMTY1MmFjNzZiODFkMWJhZTk5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBaaGFvIEp1bndhbmcgPHpoandwa3VAZ21haWwuY29tPgpEYXRl OiBTYXQsIDI0IEF1ZyAyMDI0IDEyOjQzOjU0ICswMDAwClN1YmplY3Q6IFtQQVRDSCB2MV0gYWRk IC5kZXZjb250YWluZXIgYW5kIC52c2NvZGUgdG8gLmdpdGlnbm9yZQoKLS0tCiAuZ2l0aWdub3Jl IHwgMiArKwogMSBmaWxlIGNoYW5nZWQsIDIgaW5zZXJ0aW9ucygrKQoKZGlmZiAtLWdpdCBhLy5n aXRpZ25vcmUgYi8uZ2l0aWdub3JlCmluZGV4IDRlOTExMzk1ZmUuLjJlZmUxYzI0YjAgMTAwNjQ0 Ci0tLSBhLy5naXRpZ25vcmUKKysrIGIvLmdpdGlnbm9yZQpAQCAtNDMsMyArNDMsNSBAQCBsaWIq LnBjCiAvUmVsZWFzZS8KIC90bXBfaW5zdGFsbC8KIC9wb3J0bG9jay8KKy5kZXZjb250YWluZXIv CisudnNjb2RlLwotLSAKMi4zOS4yCgo= --0000000000009bafad06206d5355--